﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace DelegateConsoleApp
{
    public class Heater
    {
        private int temperature;

        public void BoilWater()
        {
            for (int i=0;i<=100;i++)
            {
                temperature = i;
                if (temperature >90)
                {
                    MakeAlert(temperature);
                    ShowMsg(temperature);
                }
            }
        }

        private void MakeAlert(int param)
        {
            Console.WriteLine("Alarm: 嘀嘀嘀,水已经 {0} 度了:", param);
        }

        private void ShowMsg(int param)
        {
            Console.WriteLine("Display: 水快开了,当前湿度: {0} 度.", param);
        }
    }
}
